window._MASELECT = {

    showSelect:function(parentNode){

        var uiObj = _GRM.getNodeObj('attrSelectLabel');
        var mainLabel = uiObj.node;

        if(uiObj.isnew){
            _MASELECT.initButton(mainLabel);
        }
        parentNode.addChild(mainLabel);
        return mainLabel;

    },

    initButton:function(mainLabel){
        var attrMask = mainLabel.getChildByName('mask')
        var attrBtns = mainLabel.getChildByName('attrChoice')
                        .getChildByName('btns').getChildren();

        attrMask.on(cc.Node.EventType.TOUCH_START, function(){
            _GRM.putNode(this);
        }, mainLabel);

        for(var i=0;i<attrBtns.length;i++){
            var btn = attrBtns[i];
            btn.attrIndex = i;
            btn.mainLabel = mainLabel;
            if(_CJB.attrList[i]){
                btn.active = true;
                btn.getChildByName('Background')
                    .getChildByName('Label')
                    .getComponent(cc.Label).string = 
                    _CJB.getDesOfAttr(_CJB.attrList[i]);
            }else{
                btn.active = false;
            }
            btn.on(cc.Node.EventType.TOUCH_START, function(){
                console.log('属性:',_CJB.attrList[this.attrIndex]);
                _CJB.addAttr(_CJB.attrList[this.attrIndex]);
                _GRM.putNode(this.mainLabel);
            }, btn);
        }

    },



}